package com.guaoran.commons.swagger.ui.config;


import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : gucheng
 * @Description : <br/>
 *  swagger 属性配置
 * @date :2018/11/15 14:13
 */
@ConfigurationProperties(prefix = SwaggerProperties.SWAGGER_PREFIX)
public class SwaggerProperties {
    public static final String SWAGGER_PREFIX = "common.swagger";

    /** is enable swagger **/
    private Boolean enabled;
    /** title **/
    private String title = "";
    /** description **/
    private String description = "";
    /** version **/
    private String version = "1.0";
    /** basePackage **/
    private String basePackage = "com";
    // 认证和服务条款
    /** license **/
    private String license = "";
    /** licenseUrl **/
    private String licenseUrl = "";
    /** termsOfServiceUrl **/
    private String termsOfServiceUrl = "";
    // 联系人
    /** contactName **/
    private String contactName = "guaoran";
    /** contactUrl **/
    private String contactUrl = "";
    /** contactEmail **/
    private String contactEmail = "";

    // 增加 security 进行页面访问时校验用户
    /** Security user name **/
    private String securityUserName = "admin";
    /** Security user password **/
    private String securityUserPassword = "admin";
    /** Security user Role name **/
    private String securityRoleName = "SWAGGER";
    /** Is it open to all? **/
    private boolean securityOpenToAll = false;

    // securitySchemes 支持方式之一 ApiKey

//    // 鉴权策略ID，对应 SecurityReferences ID
//    /** authorizationName **/
//    private String authorizationName = "Authorization";
//    // 鉴权传递的Header参数
//    /** authorizationKeyName **/
//    private String authorizationKeyName = "TOKEN";
//    // 需要开启鉴权URL的正则
//    private String authorizationAuthRegex = "^.*$";

    // 基本路径 需要处理的基础URL规则，默认：/**
    private List<String> basePath = new ArrayList<>();
    // 排除路径
    private List<String> excludePath = new ArrayList<>();


    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getBasePackage() {
        return basePackage;
    }

    public void setBasePackage(String basePackage) {
        this.basePackage = basePackage;
    }

    public String getLicense() {
        return license;
    }

    public void setLicense(String license) {
        this.license = license;
    }

    public String getLicenseUrl() {
        return licenseUrl;
    }

    public void setLicenseUrl(String licenseUrl) {
        this.licenseUrl = licenseUrl;
    }

    public String getTermsOfServiceUrl() {
        return termsOfServiceUrl;
    }

    public void setTermsOfServiceUrl(String termsOfServiceUrl) {
        this.termsOfServiceUrl = termsOfServiceUrl;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactUrl() {
        return contactUrl;
    }

    public void setContactUrl(String contactUrl) {
        this.contactUrl = contactUrl;
    }

    public String getContactEmail() {
        return contactEmail;
    }

    public void setContactEmail(String contactEmail) {
        this.contactEmail = contactEmail;
    }

    public String getSecurityUserName() {
        return securityUserName;
    }

    public void setSecurityUserName(String securityUserName) {
        this.securityUserName = securityUserName;
    }

    public String getSecurityUserPassword() {
        return securityUserPassword;
    }

    public void setSecurityUserPassword(String securityUserPassword) {
        this.securityUserPassword = securityUserPassword;
    }

    public String getSecurityRoleName() {
        return securityRoleName;
    }

    public void setSecurityRoleName(String securityRoleName) {
        this.securityRoleName = securityRoleName;
    }

    public boolean isSecurityOpenToAll() {
        return securityOpenToAll;
    }

    public void setSecurityOpenToAll(boolean securityOpenToAll) {
        this.securityOpenToAll = securityOpenToAll;
    }
//    public String getAuthorizationName() {
//        return authorizationName;
//    }
//
//    public void setAuthorizationName(String authorizationName) {
//        this.authorizationName = authorizationName;
//    }
//
//    public String getAuthorizationKeyName() {
//        return authorizationKeyName;
//    }
//
//    public void setAuthorizationKeyName(String authorizationKeyName) {
//        this.authorizationKeyName = authorizationKeyName;
//    }
//
//    public String getAuthorizationAuthRegex() {
//        return authorizationAuthRegex;
//    }
//
//    public void setAuthorizationAuthRegex(String authorizationAuthRegex) {
//        this.authorizationAuthRegex = authorizationAuthRegex;
//    }

    public List<String> getBasePath() {
        return basePath;
    }

    public void setBasePath(List<String> basePath) {
        this.basePath = basePath;
    }

    public List<String> getExcludePath() {
        return excludePath;
    }

    public void setExcludePath(List<String> excludePath) {
        this.excludePath = excludePath;
    }
}
